package com.nbsaas.boot.shop.rest.resource;

import com.nbsaas.boot.shop.api.apis.ShopOauthTokenApi;
import com.nbsaas.boot.shop.data.entity.ShopOauthToken;
import com.nbsaas.boot.shop.api.domain.request.ShopOauthTokenRequest;
import com.nbsaas.boot.shop.api.domain.response.ShopOauthTokenResponse;
import com.nbsaas.boot.shop.api.domain.simple.ShopOauthTokenSimple;
import com.nbsaas.boot.shop.rest.convert.ShopOauthTokenSimpleConvert;
import com.nbsaas.boot.shop.rest.convert.ShopOauthTokenEntityConvert;
import com.nbsaas.boot.shop.rest.convert.ShopOauthTokenResponseConvert;
import com.nbsaas.boot.shop.data.repository.ShopOauthTokenRepository;

import java.io.Serializable;
import com.nbsaas.boot.jpa.data.core.BaseResource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import org.springframework.data.jpa.repository.support.JpaRepositoryImplementation;

import java.util.function.Function;
/**
*   -业务接口实现
*/
@Transactional
@Service
public class ShopOauthTokenResource extends BaseResource<ShopOauthToken,ShopOauthTokenResponse, ShopOauthTokenSimple, ShopOauthTokenRequest>  implements ShopOauthTokenApi {

    @Resource
    private ShopOauthTokenRepository shopOauthTokenRepository;

    @Override
    public JpaRepositoryImplementation<ShopOauthToken, Serializable> getJpaRepository() {
        return shopOauthTokenRepository;
    }

    @Override
    public Function<ShopOauthToken, ShopOauthTokenSimple> getConvertSimple() {
        return new ShopOauthTokenSimpleConvert();
    }

    @Override
    public Function<ShopOauthTokenRequest, ShopOauthToken> getConvertForm() {
        return new ShopOauthTokenEntityConvert();
    }

    @Override
    public Function<ShopOauthToken, ShopOauthTokenResponse> getConvertResponse() {
        return new ShopOauthTokenResponseConvert();
    }




}


